<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
 * Copyright (C) 2003-2010 Frederico Caldeira Knabben
 *
 * == BEGIN LICENSE ==
 *
 * Licensed under the terms of any of the following licenses at your
 * choice:
 *
 *  - GNU General Public License Version 2 or later (the "GPL")
 *    http://www.gnu.org/licenses/gpl.html
 *
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
 *    http://www.gnu.org/licenses/lgpl.html
 *
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
 *    http://www.mozilla.org/MPL/MPL-1.1.html
 *
 * == END LICENSE ==
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>FCKTools.AddEventListenerEx</title>
	<style type="text/css">

		.Ok
		{
			background-color: green ;
		}

		.Failed
		{
			background-color: red ;
		}

		input
		{
			width: 150px;
		}

	</style>
	<script type="text/javascript">
var FCK = new Object() ;	// Used by fckconfig
	</script>
	<script src="../../../editor/_source/fckjscoreextensions.js" type="text/javascript"></script>
	<script src="../../../editor/_source/internals/fckbrowserinfo.js" type="text/javascript"></script>
	<script src="../../../editor/_source/classes/fckiecleanup.js" type="text/javascript"></script>
	<script src="../../../editor/_source/internals/fcktools.js" type="text/javascript"></script>
	<script type="text/javascript">

function LoadScript( url )
{
	document.write( '<script type="text/javascript" src="' + url + '"><\/script>' ) ;
}
var sSuffix = FCKBrowserInfo.IsIE ? 'ie' : 'gecko' ;
LoadScript( '../../../editor/_source/internals/fcktools_' + sSuffix + '.js' ) ;

	</script>
	<script type="text/javascript">

if ( FCKBrowserInfo.IsIE )
	FCK.IECleanup = new FCKIECleanup( window ) ;

FCKTools.RegisterDollarFunction( window ) ;

window.onload = function()
{
	FCKTools.AddEventListenerEx( $('xBtnClick'), 'click', OnClick ) ;
	FCKTools.AddEventListenerEx( $('xBtnClickParams'), 'click', OnClickParams, [ document.body, 'Test' ] ) ;
}

function OnClick( e )
{
	$('xOnClick').className = ( e.type == 'click' && this.id == 'xBtnClick' ? 'Ok' : 'Failed' ) ;
}

function OnClickParams( e, el, str )
{
	$('xOnClickParams').className = ( e.type == 'click' && this.id == 'xBtnClickParams' && el.tagName == 'BODY' && str == 'Test' ? 'Ok' : 'Failed' ) ;
}

	</script>
</head>
<body>
	<h1>FCKTools.AddEventListenerEx</h1>
	<p>
		Click the following buttons. A green box must appear at their right side.
	</p>
	<table align="center">
		<tr>
			<td>
				<input id="xBtnClick" type="button" value="OnClick" /></td>
			<td id="xOnClick" width="100">
			</td>
		</tr>
		<tr>
			<td>
				<input id="xBtnClickParams" type="button" value="OnClick + Params" /></td>
			<td id="xOnClickParams" width="100">
			</td>
		</tr>
	</table>
</body>
</html>
